package com.myrpc.util;

import lombok.Getter;
import lombok.Setter;

import java.util.concurrent.TimeUnit;

/**
 * 线程池配置参数
 */
@Getter
@Setter
public class ThreadPoolConfig {
    /**
     * 默认核心线程数
     */
    private static final int defaultCorePoolSize = 10;
    /**
     * 默认最大线程数
     */
    private static final int defaultMaximumPoolSize = 100;
    /**
     * 默认生存时间
     */
    private static final long defaultKeepAliveTime = 1L;
    /**
     * 默认时间单位
     */
    private static final TimeUnit defaultTimeUnite = TimeUnit.MINUTES;
    /**
     * 默认阻塞队列容量
     */
    private static final int defaultBlockingQueueCapacity = 100;

    /**
     * 核心线程数
     */
    private int corePoolSize = defaultCorePoolSize;
    /**
     * 最大线程数
     */
    private int maximumPoolSize = defaultMaximumPoolSize;
    /**
     * 生存时间
     */
    private long keepAliveTime = defaultKeepAliveTime;
    /**
     * 时间单位
     */
    private TimeUnit timeUnit = defaultTimeUnite;
    /**
     * 阻塞队列容量
     */
    private int blockingQueueCapacity = defaultBlockingQueueCapacity;
}
